home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / schedctl.h.z / schedctl.h
C/C++ Source or Header  |  1992-04-03  |  3KB  |  105 lines

  1. /**************************************************************************
  2.  *                                      *
  3.  *          Copyright (C) 1986, Silicon Graphics, Inc.          *
  4.  *                                      *
  5.  *  These coded instructions, statements, and computer programs  contain  *
  6.  *  unpublished  proprietary  information of Silicon Graphics, Inc., and  *
  7.  *  are protected by Federal copyright law.  They  may  not be disclosed  *
  8.  *  to  third  parties  or copied or duplicated in any form, in whole or  *
  9.  *  in part, without the prior written consent of Silicon Graphics, Inc.  *
  10.  *                                      *
  11.  **************************************************************************/
  12. #ifndef __SYS_SCHEDCTL_H__
  13. #define __SYS_SCHEDCTL_H__
  14.  
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18.  
  19. #ident    "$Revision: 3.15 $"
  20.  
  21. #include "sys/sysmp.h"
  22.  
  23. /* defines for schedctl() commands */
  24. #define    NDPRI        MPTS_RTPRI
  25. #define    SLICE        MPTS_SLICE
  26. #define    RENICE        MPTS_RENICE
  27.  
  28. /*
  29.  * Additional schedctl commands.  These give precise emulation of the BSD4.3
  30.  * getpriority and setpriority system calls.  They may be invoked through the
  31.  * schedctl interface or by the direct system call hooks.
  32.  */
  33. #define RENICE_PROC    MPTS_RENICE_PROC
  34. #define RENICE_PGRP    MPTS_RENICE_PGRP
  35. #define RENICE_USER    MPTS_RENICE_USER
  36. #define    GETNICE_PROC    MPTS_GTNICE_PROC
  37. #define GETNICE_PGRP    MPTS_GTNICE_PGRP
  38. #define GETNICE_USER    MPTS_GTNICE_USER
  39.  
  40. /* More schedctl commands */
  41. #define SETHINTS    MPTS_SETHINTS
  42. #define SCHEDMODE    MPTS_SCHEDMODE
  43. #define SETMASTER    MPTS_SETMASTER
  44.  
  45. /* possible non-degrading priorities */
  46.  
  47. /* these priorities are higher than ALL normal user process priorities */
  48. #define NDPHIMAX    30
  49. #define NDPHIMIN    39
  50.  
  51. /* these priorities overlap normal user process priorities */
  52. #define NDPNORMMAX    40
  53. #define NDPNORMMIN    127
  54.  
  55. /* these priorities are below ALL normal user process priorities */
  56. #define NDPLOMAX    128
  57. #define NDPLOMIN    254
  58.  
  59. /* values for share group scheduling mode (schedctl(SCHEDMODE)) */
  60. #define SGS_FREE    1    /* all procs schedule independently */
  61. #define SGS_SINGLE    2    /* only one process runs */
  62. #define SGS_EQUAL    3    /* all processes get equal share of cpu */
  63. #define SGS_GANG    4    /* all processes gang schedule */
  64.  
  65. #if defined(_LANGUAGE_C) || defined(_LANGUAGE_C_PLUS_PLUS)
  66. #ifndef _KERNEL
  67. int schedctl(int, ...);
  68. #endif
  69. #endif
  70.  
  71. #ifdef _KERNEL
  72. /*
  73.  * Scheduling discipline definitions
  74.  */
  75. #define NDISCIPLINES    3
  76. #define SD_UNIX_SCHED    0    /* normal unix scheduling */
  77. #define SD_GFX_SCHED    1    /* graphics scheduling discipline */
  78. #define SD_MP_SCHED    2    /* shared process group scheduling disc */
  79. #define SD_UNIX_MASK    (1<<SD_UNIX_SCHED)
  80. #define SD_GFX_MASK    (1<<SD_GFX_SCHED)
  81. #define SD_MP_MASK    (1<<SD_MP_SCHED)
  82. #define SD_MASK_ALL    (SD_UNIX_MASK|SD_GFX_MASK|SD_MP_MASK)
  83.  
  84. struct sched_disc {        /* information per discipline */
  85.     int    (*sd_disc)();    /* discipline entry point */
  86. };
  87.  
  88. struct sched_cpu {        /* per cpu scheduling information */
  89.     uint    sc_dvec;    /* bit vector of disciplines run by the cpu */
  90. };
  91.  
  92. extern struct sched_disc sdisc[];
  93. extern struct sched_cpu scpu[];
  94.  
  95. /* system configurable parameter */
  96. extern unchar ndpri_hilim, ndpri_lolim;
  97.  
  98. #endif
  99.  
  100. #ifdef __cplusplus
  101. }
  102. #endif
  103.  
  104. #endif /* __SYS_SCHEDCTL_H__ */
  105.